/**
 * @file
 * @author  Tsin Smith <tsin.creator@gmail.com>
 *
 */

#ifndef __TSIN_UTIL_EVENTMEDIATOR_HPP__
#define __TSIN_UTIL_EVENTMEDIATOR_HPP__

#include <tsin/util/common.hpp>

namespace tsin {

        class EventSource;
        class EventListener;

        class UTIL_DLLEXPORT EventMediator
        {
        public:
                static EventMediator *get();
                void clear();

                int requestEventRange(int size);

                void registerListener(EventListener *listener, int eventNo);
                void broadcastEvent(EventSource *source, int eventNo);

        private:
                EventMediator();
                ~EventMediator();

                static EventMediator *mediator;

                int eventRequested;
        };

}

#endif /* __TSIN_UTIL_EVENTMEDIATOR_HPP__ */
